<template>
  <div id="page">
    <div v-show="isWx" class="container">
      <div class="top" :style="style?!isIos:''">
        <img v-show="isIos" v-src="'/static/img/isWxOpen/iosGaid.png'" alt="">
        <img v-show="!isIos" v-src="'/static/img/isWxOpen/androidGaid.png'" alt="">
      </div>
      <div class="bottom">
      <img v-src="'/static/img/isWxOpen/bottom.png'" alt="">
    </div>
    </div>
  </div>
</template>
<script>
  import MDUtils from 'src/assets/js/md-utils';
  export default {
    data() {
      return {
        taobaoLink: MDUtils.getQueryParam('link'),
        isWx:MDUtils.isWx(),
        isIos:MDUtils.is_ios(),
        style:{
          'margin-left': '0.74rem',
          'width':'6.36rem'
        }
      }
    },
    created() {
      var taobaoUrl = decodeURIComponent(MDUtils.getQueryParam('link'));
      if(MDUtils.isWx()){
        this.open(taobaoUrl)
      }else {
        window.location.href=taobaoUrl;
      }
    },
    mounted() {

    },
    methods: {
      open(url) {
        var tb_url = url.replace("http://", "").replace("https://", "");
        window.location = "taobao://" + tb_url;
       // alert(window.location);
         //window.setTimeout(function () { window.location = url; }, 4000)
      },
      openApp(url) {
        var tb_url = url.replace("http://", "").replace("https://", "");

        var ifr = document.createElement('iframe');

        ifr.src = 'taobao://' + tb_url;

        ifr.style.display = 'none';

        document.body.appendChild(ifr);

        window.location = url;



      }
    }
  }
</script>
<style lang="less">
  @import "index";
</style>
